<template>
  <el-dialog :title="title" :visible.sync="open" width="960px" append-to-body>
    <el-table v-loading="loading" :data="recordList">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="业务类型" align="center" prop="businessType" >
        <!--<template slot-scope="scope">-->
          <!--{{ dict.label.business_type[scope.row.businessType] }}-->
        <!--</template>-->
      </el-table-column>
      <el-table-column label="使用金额" align="center" prop="amountAmount" />
      <el-table-column label="业务单据" align="center" prop="businessNo" />
      <el-table-column label="时间" align="center" prop="createTime" />
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </el-dialog>
</template>

<script>

  import { listMixin } from "@/utils/mixins/listMixin";

  import {listAgainstRecord} from "@/api/payfee/advanceReceipt";
  export default {
    mixins:[ listMixin ],
    dicts:[ 'business_type' ],
    data() {
      return {
        open:false,
        title:'预收款余额使用记录',
        // 冲抵记录表格数据
        recordList: [],
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          madvanceReceiptId: null
        },
      };
    },
    created() {

    },
    methods: {
      show(option){
        this.queryParams.madvanceReceiptId = option.madvanceReceiptId
        this.open = true
        this.handleQuery()
      },
      /** 查询冲抵记录列表 */
      getList() {
        this.loading = true;
        listAgainstRecord(this.queryParams).then(response => {
          this.recordList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
    }
  };
</script>
